package D2;

/**
 * Created with IntelliJ IDEA.
 * Description:
 * User: 86183
 * Date: 2024-05-16
 * Time: 11:37
 */
interface A {

}
interface B {

}
public class Rectangle extends Geometry implements A,B{
    private double width;
    private double height;
    public Rectangle(){
        super();
    }

    public Rectangle(double width, double height) {
        super();
        setHeight(height);
        setWidth(width);
    }


    public double getWidth() {
        return width;
    }

    public double getHeight() {
        return height;
    }

    public void setWidth(double width) {
        this.width = width;
    }

    public void setHeight(double height) {
        this.height = height;
    }

    @Override
    public double getArea() {
        return width*height;
    }

    @Override
    public String toString() {
        return "长方形的宽是"+width+"，长是"+height;
    }
}

